******************************************************************************************************
** title:		Candidate Authenticity: �To thine own self be true�			 						**
** authors:		Dieter Stiers, Jac Larner, John Kenny, Sofia Breitenstein,		 					**
**				Florence Vall�e-Dubois, Michael Lewis-Beck											**
** datasets:	"Belgium 1_coded", "Belgium_2_coded" "Wales_coded", "Wales_long", "Scotland_coded", **
**				"Scotland_long", "Denmark_coded", "Denmark_long", "Spain_coded"						**
** date:		September 2019																		**
******************************************************************************************************

/* This do-file replicates all main and supplementary analyses that are reported 
in the article and the online appendix. All analyses were performed using Stata 13. 
To avoid having to load each data set several times, the analyses are sorted by data set 
rather than by analysis. Furthermore, as the models calculating the estimates displayed 
in the figures are reported in the appendix, we report the analyses reported in the 
main text and the appendices together.Each time it is noted which table is being replicated 
in the respective analysis
Note that the figures consist of separate parts by country. Each figure is created and
stored in memory, and brought together to the final figures at the bottom of this do file	*/

set more off

//cd: 	//Add path to working directory

*Optional ado to install if not already intalled
//ssc install fre

**************************************
**Analyses Pilot Study ("Belgium 1")**
**************************************

*** Load data ***
use "Belgium_1_coded.dta", clear

*Proportion of missing values (Table B.1 in Appendix B)
fre transparent bold consistent conviction honest truthful

************************
**Analyses U.S.A. data**
************************

*** Load data in wide format ***
use "USA_coded.dta", clear

*Proportion of missing values (Table B.2 in Appendix B)
fre transparent_* bold_* consistent_* conviction_* honest_* truthful_*

*Correlations between items for each candidate respectively (Tables D.1-D.4 in Appendix D)
corr transparent_1 bold_1 consistent_1 conviction_1 honest_1 truthful_1
corr transparent_2 bold_2 consistent_2 conviction_2 honest_2 truthful_2
corr transparent_3 bold_3 consistent_3 conviction_3 honest_3 truthful_3
corr transparent_4 bold_4 consistent_4 conviction_4 honest_4 truthful_4

*Exploratory factor analyses by politician (Table E.1 in Appendix E)
factor transparent_1 bold_1 consistent_1 conviction_1 honest_1 truthful_1
alpha transparent_1 bold_1 consistent_1 conviction_1 honest_1 truthful_1
factor transparent_2 bold_2 consistent_2 conviction_2 honest_2 truthful_2
alpha transparent_2 bold_2 consistent_2 conviction_2 honest_2 truthful_2
factor transparent_3 bold_3 consistent_3 conviction_3 honest_3 truthful_3
alpha transparent_3 bold_3 consistent_3 conviction_3 honest_3 truthful_3
factor transparent_4 bold_4 consistent_4 conviction_4 honest_4 truthful_4
alpha transparent_4 bold_4 consistent_4 conviction_4 honest_4 truthful_4

*Regression models explaining leader evaluations (Figure 1 and Table F.1 in Appendix F)
regress evaluation_1 authenticity_Trump age i.sex i.education income
est store m1 
regress evaluation_2 authenticity_Rubio age i.sex i.education income
est store m2
regress evaluation_3 authenticity_Sanders age i.sex i.education income
est store m3
regress evaluation_4 authenticity_AOC age i.sex i.education income
est store m4

//Part of Figure 1
coefplot (m1,keep(authenticity_Trump)) (m2,keep(authenticity_Rubio)) ///
(m3,keep(authenticity_Sanders)) (m4,keep(authenticity_AOC))	///
, nooffsets scheme(s1mono) legend(off) title("U.S.A.")	///
coeflabels(authenticity_Trump="Trump" authenticity_Rubio="Rubio" authenticity_Sanders="Sanders"	authenticity_AOC=`"" Ocasio-" "Cortez ""')	///
msymbol(O) mcolor(black) ciopts(color(black)) xscale(range(1 2.5)) xlabel(1(0.5)2.5) name(F1, replace)

*Regression models explaining leader evaluations including interaction with interest (Table G.1 in Appendix G)
regress evaluation_1 age i.sex i.education income c.authenticity_Trump##c.interest
est store m1 
regress evaluation_2 age i.sex i.education income c.authenticity_Rubio##c.interest
est store m2
regress evaluation_3 age i.sex i.education income c.authenticity_Sanders##c.interest
est store m3
regress evaluation_4 age i.sex i.education income c.authenticity_AOC##c.interest
est store m4

*Regression models predicting the vote intention (Figure 2 and Table H.1 in Appendix H)
logit vote_1 authenticity_Trump age i.sex i.education income
margins, dydx(authenticity_Trump) post
est store m1
logit vote_2 authenticity_Rubio age i.sex i.education income
margins, dydx(authenticity_Rubio) post
est store m2
logit vote_3 authenticity_Sanders age i.sex i.education income
margins, dydx(authenticity_Sanders) post
est store m3
logit vote_4 authenticity_AOC age i.sex i.education income
margins, dydx(authenticity_AOC) post
est store m4

//Part of Figure 2
coefplot (m1,keep(authenticity_Trump)) (m2,keep(authenticity_Rubio)) ///
(m3,keep(authenticity_Sanders)) (m4,keep(authenticity_AOC))	///
, scheme(s1mono) legend(off) title("U.S.A.") nooffsets	///
coeflabels(authenticity_Trump="Trump" authenticity_Rubio="Rubio" authenticity_Sanders="Sanders"	authenticity_AOC=`"" Ocasio-" "Cortez ""')	///
msymbol(O) mcolor(black) ciopts(color(black)) xscale(range(0 0.3)) xlabel(0(0.1)0.3) name(F_1, replace)

*Single authenticity question? (Table L.1 in Appendix L)
corr afraid_trump authenticity_Trump
corr afraid_rubio authenticity_Rubio
corr afraid_sanders authenticity_Sanders
corr afraid_aoc authenticity_AOC

corr authen_trump authenticity_Trump
corr authen_rubio authenticity_Rubio
corr authen_sanders authenticity_Sanders
corr authen_aoc authenticity_AOC

*** Load data in long format ***
use "USA_long.dta", clear

*Correlation between different items (Table 1)
corr transparent bold consistent conviction honest truthful

*Exploratory factor analysis (Table 2)
factor transparent bold consistent conviction honest truthful
alpha transparent bold consistent conviction honest truthful

*Conditional logistic regression models predicting the vote intention (Figure 3 and Table I.1 in Appendix I)
xi: asclogit vote authenticity pid, casevars(age i.sex income) case(ID) alternatives(leader) basealternative(1)

*Comparison to other traits
//Correlations (Table J.2 in Appendix J)
corr transparent bold consistent conviction honest truthful ///
competence_1 competence_2 integrity_1 integrity_2 integrity_3	///
empathy_1 empathy_2 leadership

//Correlations (Table 3)
corr authenticity competence integrity warmth leadership

//Factor analysis (Table 4)
factor transparent bold consistent conviction honest truthful ///
competence_1 competence_2 integrity_1 integrity_2 integrity_3	///
empathy_1 empathy_2 leadership
rotate

//Factor analysis on items available in Belgium (Table K.1 in Appendix K)
factor bold conviction  ///
competence_1 competence_2 integrity_1 integrity_3
rotate

//Conditional logistic regression models predicting the vote intention (Table 5)
drop if missing(authenticity,competence,warmth,integrity,leadership,pid,evaluation)	//create estimation sample
clogit vote authenticity competence warmth integrity leadership, group(ID)
clogit vote authenticity competence warmth integrity leadership pid, group(ID)

***********************
**Analyses Welsh data**
***********************

*** Load data in wide format ***
use "Wales_coded.dta", clear

*Proportion of missing values (Table B.4 in Appendix B)
fre transparent_* bold_* consistent_* conviction_*

*Correlations between items for each candidate respectively (Tables D.5-D.10 in Appendix D)
corr transparent_1 bold_1 consistent_1 conviction_1
corr transparent_2 bold_2 consistent_2 conviction_2
corr transparent_3 bold_3 consistent_3 conviction_3
corr transparent_4 bold_4 consistent_4 conviction_4
corr transparent_5 bold_5 consistent_5 conviction_5
corr transparent_6 bold_6 consistent_6 conviction_6

*Exploratory factor analyses by politician (Table E.2 in Appendix E)
factor transparent_1 bold_1 consistent_1 conviction_1
alpha transparent_1 bold_1 consistent_1 conviction_1
factor transparent_2 bold_2 consistent_2 conviction_2
alpha transparent_2 bold_2 consistent_2 conviction_2
factor transparent_3 bold_3 consistent_3 conviction_3
alpha transparent_3 bold_3 consistent_3 conviction_3 
factor transparent_4 bold_4 consistent_4 conviction_4
alpha transparent_4 bold_4 consistent_4 conviction_4
factor transparent_5 bold_5 consistent_5 conviction_5
alpha transparent_5 bold_5 consistent_5 conviction_5
factor transparent_6 bold_6 consistent_6 conviction_6
alpha transparent_6 bold_6 consistent_6 conviction_6

*Regression models explaining leader evaluations (Figure 1 and Table F.2 in Appendix F)
regress evaluation_1 authenticity_May age i.sex i.education income
est store m1 
regress evaluation_2 authenticity_Corbyn age i.sex i.education income
est store m2
regress evaluation_3 authenticity_Cable age i.sex i.education income
est store m3
regress evaluation_4 authenticity_Jones age i.sex i.education income
est store m4
regress evaluation_5 authenticity_Wood age i.sex i.education income
est store m5
regress evaluation_6 authenticity_Davies age i.sex i.education income
est store m6

//Part of Figure 1
coefplot (m1,keep(authenticity_May)) (m2,keep(authenticity_Corbyn)) (m3,keep(authenticity_Cable)) ///
(m4,keep(authenticity_Jones)) (m5,keep(authenticity_Wood)) (m6,keep(authenticity_Davies))	///
, nooffsets scheme(s1mono) legend(off) title("Wales")	///
coeflabels(authenticity_May="May" authenticity_Corbyn="Corbyn" authenticity_Cable="Cable"	///
authenticity_Jones="Jones" authenticity_Wood="Wood" authenticity_Davies="  Davies")	///
msymbol(O) mcolor(black) ciopts(color(black)) xscale(range(1 2.5)) xlabel(1(0.5)2.5) name(F2, replace)

*Regression models explaining leader evaluations including interaction with interest (Table G.2 in Appendix G)
regress evaluation_1 age i.sex i.education income c.authenticity_May##c.interest
est store m1 
regress evaluation_2 age i.sex i.education income c.authenticity_Corbyn##c.interest
est store m2
regress evaluation_3 age i.sex i.education income c.authenticity_Cable##c.interest
est store m3
regress evaluation_4 age i.sex i.education income c.authenticity_Jones##c.interest
est store m4
regress evaluation_5 age i.sex i.education income c.authenticity_Wood##c.interest
est store m5
regress evaluation_6 age i.sex i.education income c.authenticity_Davies##c.interest
est store m6

*Regression models predicting the vote intention (Figure 2 and Table H.2 in Appendix H)
logit vote_1 authenticity_May age i.sex i.education income
margins, dydx(authenticity_May) post
est store m1
logit vote_2 authenticity_Corbyn age i.sex i.education income
margins, dydx(authenticity_Corbyn) post
est store m2
logit vote_3 authenticity_Cable age i.sex i.education income
margins, dydx(authenticity_Cable) post
est store m3
logit vote_2 authenticity_Jones age i.sex i.education income
margins, dydx(authenticity_Jones) post
est store m4
logit vote_5 authenticity_Wood age i.sex i.education income
margins, dydx(authenticity_Wood) post
est store m5
logit vote_1 authenticity_Davies age i.sex i.education income
margins, dydx(authenticity_Davies) post
est store m6

//Part of Figure 2
coefplot (m1,keep(authenticity_May)) (m2,keep(authenticity_Corbyn)) (m3,keep(authenticity_Cable)) ///
(m4,keep(authenticity_Jones)) (m5,keep(authenticity_Wood))(m6,keep(authenticity_Davies))	///
, scheme(s1mono) legend(off) title("Wales") nooffsets	///
coeflabels(authenticity_May="May" authenticity_Corbyn="  Corbyn" authenticity_Cable="Cable" ///
authenticity_Jones = "Jones" authenticity_Wood="Wood" authenticity_Davies= "Davies")	///
msymbol(O) mcolor(black) ciopts(color(black)) xscale(range(0 0.3)) xlabel(0(0.1)0.3) name(F_2, replace)

*** Load data in long format ***
use "Wales_long.dta", clear

*Correlation between different items (Table 1)
corr transparent bold consistent conviction

*Exploratory factor analysis (Table 2)
factor transparent bold consistent conviction
alpha transparent bold consistent conviction

*Conditional logistic regression models predicting the vote intention (Figure 3 and Table I.1 in Appendix I)
xi: asclogit vote authenticity pid, casevars(age i.sex income) case(ID) alternatives(leader) basealternative(1)

**************************
**Analyses Scottish data**
**************************

*** Load data in wide format ***
use "Scotland_coded.dta", clear

*Proportion of missing values (Table B.5 in Appendix B)
fre transparent_* bold_* consistent_* conviction_*

*Correlations between items for each candidate respectively (Tables D.11-D.16 in Appendix D)
corr transparent_1 bold_1 consistent_1 conviction_1
corr transparent_2 bold_2 consistent_2 conviction_2
corr transparent_3 bold_3 consistent_3 conviction_3
corr transparent_4 bold_4 consistent_4 conviction_4
corr transparent_5 bold_5 consistent_5 conviction_5
corr transparent_6 bold_6 consistent_6 conviction_6

*Exploratory factor analyses by politician (Table E.3 in Appendix E)
factor transparent_1 bold_1 consistent_1 conviction_1
alpha transparent_1 bold_1 consistent_1 conviction_1
factor transparent_2 bold_2 consistent_2 conviction_2
alpha transparent_2 bold_2 consistent_2 conviction_2
factor transparent_3 bold_3 consistent_3 conviction_3
alpha transparent_3 bold_3 consistent_3 conviction_3 
factor transparent_4 bold_4 consistent_4 conviction_4
alpha transparent_4 bold_4 consistent_4 conviction_4
factor transparent_5 bold_5 consistent_5 conviction_5
alpha transparent_5 bold_5 consistent_5 conviction_5
factor transparent_6 bold_6 consistent_6 conviction_6
alpha transparent_6 bold_6 consistent_6 conviction_6

*Regression models explaining leader evaluations (Figure 1 and Table F.3 in Appendix F)
regress evaluation_1 authenticity_May age i.sex i.education income
est store m1
regress evaluation_2 authenticity_Corbyn age i.sex i.education income
est store m2
regress evaluation_3 authenticity_Cable age i.sex i.education income
est store m3
regress evaluation_4 authenticity_Sturgeon age i.sex i.education income
est store m4
regress evaluation_5 authenticity_Davidson age i.sex i.education income
est store m5
regress evaluation_6 authenticity_Leonard age i.sex i.education income
est store m6

//Part of Figure 1
coefplot (m1,keep(authenticity_May)) (m2,keep(authenticity_Corbyn)) (m3,keep(authenticity_Cable)) ///
(m4,keep(authenticity_Sturgeon)) (m5,keep(authenticity_Davidson)) (m6,keep(authenticity_Leonard))	///
, nooffsets scheme(s1mono) legend(off) legend(off) title("Scotland")	///
coeflabels(authenticity_May="May" authenticity_Corbyn="Corbyn" authenticity_Cable="Cable"	///
authenticity_Sturgeon="Sturgeon" authenticity_Davidson="Davidson" authenticity_Leonard="Leonard")	///
msymbol(O) mcolor(black) ciopts(color(black)) xscale(range(1 2.5)) xlabel(1(0.5)2.5) name(F3, replace)

*Regression models explaining leader evaluations including interaction with interest (Table G.3 in Appendix G)
regress evaluation_1 age i.sex i.education income c.authenticity_May##c.interest
est store m1
regress evaluation_2 age i.sex i.education income c.authenticity_Corbyn##c.interest
est store m2
regress evaluation_3 age i.sex i.education income c.authenticity_Cable##c.interest
est store m3
regress evaluation_4 age i.sex i.education income c.authenticity_Sturgeon##c.interest
est store m4
regress evaluation_5 age i.sex i.education income c.authenticity_Davidson##c.interest
est store m5
regress evaluation_6 age i.sex i.education income c.authenticity_Leonard##c.interest
est store m6

*Regression models predicting the vote intention (Figure 2 and Table H.3 in Appendix H)
logit vote_1 authenticity_May age i.sex i.education income
margins, dydx(authenticity_May) post
est store m1
logit vote_2 authenticity_Corbyn age i.sex i.education income
margins, dydx(authenticity_Corbyn) post
est store m2
logit vote_3 authenticity_Cable age i.sex i.education income
margins, dydx(authenticity_Cable) post
est store m3
logit vote_4 authenticity_Sturgeon age i.sex i.education income
margins, dydx(authenticity_Sturgeon) post
est store m4
logit vote_1 authenticity_Davidson age i.sex i.education income
margins, dydx(authenticity_Davidson) post
est store m5
logit vote_2 authenticity_Leonard age i.sex i.education income
margins, dydx(authenticity_Leonard) post
est store m6

//Part of Figure 2
coefplot (m1,keep(authenticity_May)) (m2,keep(authenticity_Corbyn)) (m3,keep(authenticity_Cable)) ///
(m4,keep(authenticity_Sturgeon))(m5,keep(authenticity_Davidson)) (m6,keep(authenticity_Leonard))  ///
, nooffsets scheme(s1mono) legend(off) title("Scotland")	///
coeflabels(authenticity_May="May" authenticity_Corbyn="Corbyn" authenticity_Cable="Cable" ///
authenticity_Sturgeon="Sturgeon" authenticity_Davidson="Davidson" authenticity_Leonard="Leonard")	///
msymbol(O) mcolor(black) ciopts(color(black)) xscale(range(0 0.3)) xlabel(0(0.1)0.3) name(F_3, replace)

*** Load data in long format ***
use "Scotland_long.dta", clear

*Correlation between different items (Table 1)
corr transparent bold consistent conviction

*Exploratory factor analysis (Table 2)
factor transparent bold consistent conviction
alpha transparent bold consistent conviction

*Conditional logistic regression models predicting the vote intention (Figure 3 and Table I.1 in Appendix I)
xi: asclogit vote authenticity pid, casevars(age i.sex income i.education) case(ID) alternatives(leader) basealternative(1)

************************
**Analyses Danish data**
************************

*** Load data in wide format ***
use "Denmark_coded.dta", clear

*Proportion of missing values (Table B.6 in Appendix B)
fre transparent_* bold_* consistent_* conviction_* honest_*

*Correlations between items for each candidate respectively (Tables D.17-D.18 in Appendix D)
corr transparent_1 bold_1 consistent_1 conviction_1 honest_1
corr transparent_2 bold_2 consistent_2 conviction_2 honest_2

*Exploratory factor analyses by politician (Table E.4 in Appendix E)
factor transparent_1 bold_1 consistent_1 conviction_1 honest_1
alpha transparent_1 bold_1 consistent_1 conviction_1 honest_2
factor transparent_2 bold_2 consistent_2 conviction_2 honest_2
alpha transparent_2 bold_2 consistent_2 conviction_2 honest_2

*Regression models explaining party evaluations (Figure 1 and Table F.4 in Appendix F)
regress evaluation_1 authenticity_1 age i.sex i.education income
est store m1
regress evaluation_2 authenticity_2 age i.sex i.education income
est store m2

coefplot (m1,keep(authenticity_1)) (m2,keep(authenticity_2)) ///
, nooffsets scheme(s1mono) legend(off) title("Denmark")	///
coeflabels(authenticity_1=`""Thulesen" "Dahl   ""' authenticity_2=`""Olsen" "Dyhr ""')	///
msymbol(O) mcolor(black) ciopts(color(black)) xscale(range(1 2.5)) xlabel(1(0.5)2.5)  name(F4, replace)

*** Load data in long format ***
use "Denmark_long.dta", clear

*Correlation between different items (Table 1)
corr transparent bold consistent conviction honest

*Exploratory factor analysis (Table 2)
factor transparent bold consistent conviction honest
alpha transparent bold consistent conviction honest

**************************************************************
**Analyses Belgian data (local election study - "Belgium 2")**
**************************************************************

*** Load data ***
use "Belgium_2_coded.dta", clear

*Comparison to other traits
//Correlations (Table J.1 in Appendix J)
corr bold conviction competence_1 competence_2 integrity_1 integrity_3

//Correlations (Table 3)
corr authenticity competence integrity

//Factor analysis (Table 4)
factor bold conviction competence_1 competence_2 integrity_1 integrity_3
rotate

*************************
**Analyses Spanish data**
*************************

*** Load data ***
use "Spain_coded.dta", clear

*Comparison to other traits
//Correlations (Table 3)
corr authenticity competence integrity

*****************
**Final figures**
*****************

*** FIGURE 1 ***
//Note: Separate figures are created and stored in memory above
graph combine F1 F2 F3 F4, scheme(lean1) c(4) r(1) xsize(7) graphregion(margin(zero))

*** FIGURE 2 ***
//Note: Separate figures are created and stored in memory above
graph combine F_1 F_2 F_3, scheme(lean1) c(3) r(1) graphregion(margin(zero)) xsize(7)

*** Figure 3 ***
//Note: Estimates are calculated above
input country coefficient lb ub
3	1.462488	0.8618404	2.063136
2 	1.38636 	0.5004011	2.272319
1	1.588579	0.0927575	3.084401  
end
twoway (rspike lb ub country , color(black)) || (scatter coefficient country, msymbol(O) mcolor(black)) 	///
, scheme(s1mono) legend(off)  xlabel(3 "U.S.A." 2 "Wales" 1 "Scotland", angle(0)) xscale(range(0.5 3.5)) ///
xtitle("Country", margin(medlarge)) ytitle("Avergae marginal effect of authenticity") yline(0, lpattern(shortdash))
